<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Message searching result</title>
    </h:head>
    <h:body>
        <h:form>
            <h:dataTable value="#{message.searchResult}" var="messageItem">
                <f:facet name="caption">Found messages</f:facet>
                <h:column>
                    <f:facet name="header">ID</f:facet>
                    #{messageItem.id}
                </h:column>
                <h:column>
                    <f:facet name="header">Caption</f:facet>
                    #{messageItem.caption}
                </h:column>
                <h:column>
                    <f:facet name="header">Text</f:facet>
                    #{messageItem.text}
                </h:column>
                <h:column>
                    <f:facet name="header">Post date</f:facet>
                    <h:outputText value="#{messageItem.postDate}">
                        <f:convertDateTime timeZone="GMT+04:00" pattern="MMM d yyyy HH:mm:ss"/>
                    </h:outputText>
                </h:column>
                <h:column>
                    <f:facet name="header">User</f:facet>
                    #{messageItem.user.id}. #{messageItem.user.name}
                </h:column>
                <h:column>
                    <f:facet name="header">Thread</f:facet>
                    #{messageItem.thread.id}. #{messageItem.thread.caption}
                </h:column>
                <h:column>
                    <h:commandLink actionListener="#{message.deleteFromSearchResult(messageItem)}" action="#{message.getAction}">delete</h:commandLink>
                </h:column>
                <h:column>
                    <h:commandLink actionListener="#{message.editFromSearchResult(messageItem)}" action="#{message.getAction}">edit</h:commandLink>
                </h:column>
            </h:dataTable>
            <br/>
            <br/>
            <h:commandButton value="To main page" action="View"/>
        </h:form>
    </h:body>
</html>

